<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:46:"themes/admin_simpleboot3/admin/user/index.html";i:1597904289;s:43:"themes/admin_simpleboot3/public/header.html";i:1584585426;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->
    <title><?php echo Config('web_name'); ?></title>

    <link href="__TMPL__/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            APP: '<?php echo \think\Request::instance()->module(); ?>'/*当前应用名*/
        };
    </script>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
    <script src="__TMPL__/public/assets/js/echarts.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip();
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>
<style type="text/css">
    table th,table td{text-align: center;}
</style>
</head>
<body>
	
	<div class="wrap js-check-wrap">
		<div>
			<h4><?php echo $company['company_name']; ?> 员工管理</h>
		</div>

		<ul class="nav nav-tabs">
			<li class="active"><a href="">管理员</a></li>
			<li><a href="<?php echo url('user/add'); ?>">员工添加</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="post" action="<?php echo url('User/index'); ?>">
            
        </form>
        <table class="table table-bordered">
        	<thead>
        		<tr>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>工号</th>
                    <th>部门</th>
                    <th>职位</th>
                    <th>手机号码</th>
                    <th>性别</th>
                    <th>最后登录时间</th>
                    <th>最后登录IP</th>
                    <th>用户状态</th>
                    <th width="150">操作</th>
        		</tr>
        	</thead>
        	<tbody>
                <?php if(is_array($userList) || $userList instanceof \think\Collection || $userList instanceof \think\Paginator): $i = 0; $__LIST__ = $userList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                <tr>
                    <td><?php echo $vo['id']; ?></td>
                    <td><?php echo $vo['user_login']; ?></td>
                    <td><?php echo $vo['employee_id']; ?></td>
                    <td><?php echo $vo['department']; ?></td>
                    <td><?php echo $vo['role']; ?></td>
                    <td><?php echo (isset($vo['mobile']) && ($vo['mobile'] !== '')?$vo['mobile']:"未设置"); ?></td>
                    <td> <?php if($vo['sex'] == 0): ?>
                        保密
                        <?php elseif($vo['sex'] == 1): ?>
                            男
                        </elseif>
                        <?php else: ?>
                        女
                    <?php endif; ?></td>
                    <td>
                        <?php if(empty($vo['last_login_time'])): ?>
                            用户还未登录
                            <?php else: ?>
                            <?php echo date('Y-m-d H:i:s',$vo['last_login_time']); endif; ?>
                    </td>
                    <td>
                        <?php if(empty($vo['last_login_ip'])): ?>
                            用户还未登录
                            <?php else: ?>
                            <?php echo $vo['last_login_ip']; endif; ?>
                    </td>
                    <td>
                        <!-- 用户状态 -->
                        <?php 
                            $color = ($vo['user_status'] == 0)?"color:red;":"color:green;";
                            echo  '<span style="'.$color.'">'.$statusStr[$vo['user_status']].'</span>';
                         ?>
                    </td>
                    <td>
                        <a href="<?php echo url('admin/user/edit'); ?>?id=<?php echo $vo['id']; ?>" class="btn btn-success btn-sm">编辑</a>
                        <?php if($vo['user_status'] == 0): ?>
                                <a href="<?php echo url('admin/user/cancelBan'); ?>?id=<?php echo $vo['id']; ?>" class="btn btn-warning btn-sm" >启用</a>
                            <?php else: ?>
                                <a href="<?php echo url('admin/user/ban'); ?>?id=<?php echo $vo['id']; ?>" class="btn btn-warning btn-sm" >禁用</a>
                        <?php endif; if($vo['id'] != 1): ?>
                            <a href="<?php echo url('admin/user/delete'); ?>?id=<?php echo $vo['id']; ?>" class="btn btn-danger btn-sm js-ajax-delete" data-msg="确定要删除吗？">删除</a>
                        <?php endif; ?> 
                    </td>
                </tr>
                <?php endforeach; endif; else: echo "" ;endif; ?>
        	</tbody>
        </table>

	<div class="pagination">
     <?php echo $userList->render(); ?>   
    </div>
	</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>